from pymongo import *

#client = MongoClient("mongodb://localhost:27017")
client = MongoClient("localhost",27017)
db = client.admin
collection = db.xiyouji
query = collection.find()
for data in query:
    print(data)
collection.update({'name':'hah'},{'name':'yuhuangdadi'})
post = {'name':'rulai','age':'23'}
collection.insert(post)

query = collection.find()
for data in query:
    print(data)
print("OK")
